<!-- 模型定义详情弹窗 -->
<template>
            <a-form
                    ref="form3"
                    class="ele-form-detail"
                    :model="modelModalApp.model"
                    :label-col="{md: {span: 2}, sm: {span: 4}, xs: {span: 6}}"
                    :wrapper-col="{md: {span: 22}, sm: {span: 20}, xs: {span: 18}}">
                <a-descriptions :title="modelModalApp.title" bordered>
                                    <a-descriptions-item label="标识">
                        {{ modelModalApp.model.Eid }}
                    </a-descriptions-item>
                                    <a-descriptions-item label="创建人">
                        {{ modelModalApp.model.creatorName }}
                    </a-descriptions-item>
                                    <a-descriptions-item label="名称">
                        {{ modelModalApp.model.name }}
                    </a-descriptions-item>
                                    <a-descriptions-item label="模型名">
                        {{ modelModalApp.model.modelName }}
                    </a-descriptions-item>
                                    <a-descriptions-item label="Sql字符串">
                        {{ modelModalApp.model.sqlString }}
                    </a-descriptions-item>
                                    <a-descriptions-item label="创造">
                        {{ modelModalApp.model.createAt }}
                    </a-descriptions-item>
                                    <a-descriptions-item label="更新">
                        {{ modelModalApp.model.updateAt }}
                    </a-descriptions-item>
                                    <a-descriptions-item label="模型类型">
                        {{ modelModalApp.model.modelType }}
                    </a-descriptions-item>
                                    <a-descriptions-item label="报表类型">
                        {{ modelModalApp.model.reporterType }}
                    </a-descriptions-item>
                                    <a-descriptions-item label="出版模式">
                        {{ modelModalApp.model.publishMode }}
                    </a-descriptions-item>
                                    <a-descriptions-item label="开始日期">
                        {{ modelModalApp.model.startDays }}
                    </a-descriptions-item>
                                    <a-descriptions-item label="填写天数">
                        {{ modelModalApp.model.fillInDays }}
                    </a-descriptions-item>
                                    <a-descriptions-item label="父模型名字">
                        {{ modelModalApp.model.parentModelId }}
                    </a-descriptions-item>
                                    <a-descriptions-item label="发布操作员名字">
                        {{ modelModalApp.model.publishOperatorId }}
                    </a-descriptions-item>
                                    <a-descriptions-item label="出版日期">
                        {{ modelModalApp.model.publishDate }}
                    </a-descriptions-item>
                                    <a-descriptions-item label="发布状态">
                        {{ modelModalApp.model.publishStatus }}
                    </a-descriptions-item>
                                    <a-descriptions-item label="在js之前保存">
                        {{ modelModalApp.model.saveBeforeJs }}
                    </a-descriptions-item>
                                    <a-descriptions-item label="Js后保存">
                        {{ modelModalApp.model.saveAfterJs }}
                    </a-descriptions-item>
                                    <a-descriptions-item label="剧本">
                        {{ modelModalApp.model.script }}
                    </a-descriptions-item>
                                    <a-descriptions-item label="是否需要附件">
                        {{ modelModalApp.model.isNeedAnnex }}
                    </a-descriptions-item>
                                    <a-descriptions-item label="儿童票据类型">
                        {{ modelModalApp.model.childrenBillType }}
                    </a-descriptions-item>
                                    <a-descriptions-item label="表格类型">
                        {{ modelModalApp.model.formType }}
                    </a-descriptions-item>
                                    <a-descriptions-item label="跨行名称定义">
                        {{ modelModalApp.model.crossRowNameDefines }}
                    </a-descriptions-item>
                                    <a-descriptions-item label="模型项定义">
                        {{ modelModalApp.model.modelItemsDefines }}
                    </a-descriptions-item>
                                    <a-descriptions-item label="公式">
                        {{ modelModalApp.model.formulas }}
                    </a-descriptions-item>
                                    <a-descriptions-item label="是调整">
                        {{ modelModalApp.model.isAduit }}
                    </a-descriptions-item>
                                    <a-descriptions-item label="部门名字">
                        {{ modelModalApp.model.departmentId }}
                    </a-descriptions-item>
                                    <a-descriptions-item label="是直的">
                        {{ modelModalApp.model.isDirect }}
                    </a-descriptions-item>
                                    <a-descriptions-item label="组ID">
                        {{ modelModalApp.model.groupId }}
                    </a-descriptions-item>
                                    <a-descriptions-item label="填写说明">
                        {{ modelModalApp.model.fillExplanation }}
                    </a-descriptions-item>
                                    <a-descriptions-item label="不创建定义">
                        {{ modelModalApp.model.notCreateDefines }}
                    </a-descriptions-item>
                                    <a-descriptions-item label="状态">
                        {{ modelModalApp.model.status }}
                    </a-descriptions-item>
                                    <a-descriptions-item label="创建人ID">
                        {{ modelModalApp.model.creatorId }}
                    </a-descriptions-item>
                                    <a-descriptions-item label="备注">
                        {{ modelModalApp.model.remark }}
                    </a-descriptions-item>
                                    <a-descriptions-item label="创建时间">
                        {{ modelModalApp.model.createDatetime }}
                    </a-descriptions-item>
                                </a-descriptions>
            </a-form>
</template>

<script>
    import {defineComponent, reactive, onMounted, inject} from "vue";
    import {useRoute} from "vue-router"
    import {ModelService} from "@/views/lims/gen/model/modelService";

    export default defineComponent({
        setup() {
            const route = useRoute();
            let routeId = route.params.id;
            let modelListApp = inject('modelListApp', reactive({}));
            const modelModalApp = reactive({id: null, model: {}, display: false});

            onMounted(() => {
                    modelModalApp.model = {};
                if (routeId) {
                        modelModalApp.id = routeId;
                } else if (modelListApp.viewModalShowing) {
                        modelModalApp.id = modelListApp.currentId;
                        modelModalApp.display = true;
                }
                if (modelModalApp.id) {
                    getInfo(modelModalApp.id);
                }
            })

            const getInfo = (id) => {
                    ModelService.findModel(id).then((res) => {
                            modelModalApp.model = res.data;
                            modelModalApp.title = "查看 " + modelModalApp.model.name;
                })
            }

            return {
                    modelModalApp,
                routeId,
                getInfo,
            }
        }
    })
</script>

<style scoped>
</style>

